package com.woniuxy.ticketorder.order.util;

import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Random;

public class OrderNumberCreator {

    //创建订单编号
    public static String createOrderNum() {
        String str = "";
        Date date = new Date();
        SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddhhmmSSSS");
        str += sdf.format(date);
        //生成随机数
        String random = new Random().nextInt(10000) + "";
        for (int i = 4; i > random.length(); i--) {
            str += "0";
        }
        str += random;
        return str;
    }

}